﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;

using System.Windows.Forms;

namespace SharePoint.MoveItems
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        
        private void btnMove_Click(object sender, EventArgs e)
        {
            try
            {
                btnMove.Enabled = false;

                int numItemsToMove = int.Parse(ctlNumItemsToMove.Text);
                string targetFolderFullUrl = ctlFolderFullUrl.Text.Trim();

                MoveItems moveitems = new MoveItems();
                moveitems.Move(numItemsToMove, targetFolderFullUrl);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
            finally
            {
                btnMove.Enabled = true;
            }
            
        }
    }
}
